home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.3 / Video Toaster v4.3.iso / 4.2 / arexx / editor / oz / 1-cut < prev    next >
Text File  |  1998-04-16  |  5KB  |  143 lines

  1. /* 1_Cut.rexx V1.3 -- Cuts the second (of 2 duplicate audio clips) out of the first - great for removing "um's & ahs" out of narrations       */
  2. /*   designed by Aussie     ©1995 Michael Holten
  3.      designed for Flyer version 4.1+
  4.  
  5.  
  6. To use:  Before starting this ARexx...
  7.  
  8.   (1) In your project screen, first select the AUDIO clip (that you wish to edit) & then 'duplicate' it.  (You now have two identical audio clips in a row)
  9.  
  10.   (2) Now select the SECOND AUDIO CLIP & open its 'controls'
  11.  
  12.   (3) Slide in 'IN' & 'OUT' markers to surround the section to have removed from the clip (i.e. surround the "um" or "ah".) & close its window when done
  13.  
  14.    (From this point on everything is automated by ARexx, there are no numbers to remember, start times to add together etc.)
  15.  
  16.   (4) Run this ARexx routine (with the second audio clip still highlighted)
  17.  
  18.                               * * *
  19.  
  20.         The Arexx routine will alter the 2 audio clips & set them up as you would have done.  The first clip will have the start through to the cut point; the "um" or "ah" is skipped over; & the second clip now has the remainder of the narration.  You can
  21. start over by duplicating the second clip & begin your next 'cut'.
  22.  
  23.         Note that the start time of the second clip has also been 'butted' up to the first clip, and is set to play immediately after the first is complete.  (Great for butting narration bits back together.)
  24.  
  25. */
  26.  
  27.  
  28.  
  29.  
  30. call remlib('PROJECT_REXX_PORT')
  31. call addlib('PROJECT_REXX_PORT',0)
  32.  
  33. /* --- begin --- */
  34. OK=1
  35. NotOK=0
  36. AudioNext=NotOK
  37. AudioPrev=NotOK
  38.  
  39. start_loc=croutonspot()
  40. if start_loc>0 then do
  41. /* --- Check previous audio clip --- */
  42.    call croutonpick(start_loc-1)
  43.    if croutontype()=" AUD" then do
  44.       AudioPrev=OK
  45.       prevaudioname=croutonname()
  46.       prevIN=croutongettag(AudioStart)
  47.       prevOUT=prevIN+croutongettag(AudioDuration)
  48.       prevstart=croutongettag(Delay)
  49.       Last_Time_Mode= croutongettag(TimeMode)  /* Locking to 2=prog time   1=inpoint 0=clip */
  50.       end
  51. /* --- Read Selected (next) audio clip --- */
  52.    call croutonpick(start_loc)
  53.    if croutontype()=" AUD" then do
  54.       AudioNext=OK
  55.       audioname=croutonname()
  56.       Cut1=croutongettag(AudioStart)
  57.       Cut2=croutongettag(AudioDuration)+Cut1
  58.       end
  59.    end
  60.  
  61. /* --- wait for any screen update delay --- */
  62. call time('R')
  63. do while (time('E')<0.5)
  64.         end
  65.  
  66. call req_open("Cut - by Aussie","----------------","Cuts the SELECTED audio clip","out of the PREVIOUS audio clip.")
  67.  
  68. /* --- Kick out if both are not audio clips --- */
  69. if AudioNext~=OK | AudioPrev~=OK then do
  70.    test=req_tell("Sorry, CANCELED!"," Both the selected & previous clips","must be AUDIO ONLY clips!  Help?")
  71.    call quit1
  72.    end
  73.  
  74. /* --- check for matching name --- */
  75. if audioname ~= prevaudioname then do
  76.    test=req_tell("Sorry, CANCELED!","   The 2 AUDIO clips MUST be","  from the identical file.  Help?")
  77.    call quit1
  78.    end
  79.  
  80. /* --- compare in & out points to avoid ridiculous problems --- */
  81. if (prevIN>=Cut1) | (Cut1>=Cut2) | (Cut2>=PrevOUT) then do
  82.    test=req_tell("Sorry, CANCELED!","  The 2nd clip's IN & OUTs must be","  INSIDE the range of the 1st.  Help?")
  83.    call quit1
  84.    end
  85.  
  86. /* --- last check to proceed --- */
  87. test = req_tell("Ok to cut this section","        from the last audio clip?")
  88. if test~=OK then call quitb
  89.  
  90.  
  91. /* --- write all settings to croutons --- */
  92. newprevduration=cut1-prevIN
  93. newnextIN=cut2
  94. newnextduration = prevOUT-cut2
  95. newnextstart=prevstart+newprevduration
  96.  
  97. call croutonpick(start_loc-1)
  98. call croutonsettag(AudioDuration,newprevduration)
  99.  
  100. call croutonpick(start_loc)
  101. call croutonsettag(AudioStart,newnextIN)
  102. call croutonsettag(AudioDuration,newnextduration)
  103. call croutonsettag(Delay,NewNextStart)
  104. call croutonsettag(TimeMode,Last_Time_Mode)  /* Locking to 2=prog time  1=inpoint   0=clip */
  105.  
  106. /* --- Wrap Up --- */
  107.  
  108. quit:
  109. call req_close()
  110. call projectupdate()
  111. call croutonpick(start_loc)
  112. call req_error(" OZ: All Done!  Cut was a success.")
  113. call remlib("PROJECT_REXX_PORT")
  114. exit
  115.  
  116.  
  117. quitb:
  118. test=req_tell("CANCELED!","            Do you want help?"," ")
  119.  
  120. quit1:
  121. call req_close()
  122. if test=OK then call quithelp
  123.  
  124. quit2:
  125. if start_loc>0 then call croutonpick(start_loc)
  126. call req_error(" OZ: Operation was <<< Canceled >>>")
  127. call remlib("PROJECT_REXX_PORT")
  128. exit
  129.  
  130.  
  131.  
  132.  
  133. /* --------------------- help stuff to explain it all */
  134. quithelp:
  135. test=req_tell("Here is help","1-Pick AUDIO clip, then DUPLICATE","2-Pick second clip & open controls")
  136. if test~=OK then return
  137.  
  138. test=req_tell("More help...","3-Set IN & OUT, mark area to cut","4-Close window & run this program")
  139. if test~=OK then return
  140.  
  141. test=req_tell("Last help..."," It will reset IN & OUT points; make"," the cut; & butt the start times. Bye")
  142. return
  143.